package GUI;

import javax.media.opengl.glu.GLU;

public class Camera 
{
	private static final float DEFAULT_EYE_X = 16.0f * 1.5f;
	private static final float DEFAULT_EYE_Y = 15.0f;
	private static final float DEFAULT_EYE_Z = 16.0f * 1.5f;	
	private static final float DEFAULT_LOC_X = 16.0f * 1.5f;
	private static final float DEFAULT_LOC_Y = 0.0f;
	private static final float DEFAULT_LOC_Z = 12.0f * 1.5f;
	private static final float DEFAULT_UPVECTOR_X = 0.0f;
	private static final float DEFAULT_UPVECTOR_Y = 1.0f;
	private static final float DEFAULT_UPVECTOR_Z = -1.0f;
	
	private float eye_x;
	private float eye_y;
	private float eye_z;	
	private float loc_x;
	private float loc_y;
	private float loc_z;
	private float upVector_x;
	private float upVector_y;
	private float upVector_z;
	
	public Camera()
	{
		this.eye_x = DEFAULT_EYE_X;
		this.eye_y = DEFAULT_EYE_Y;
		this.eye_z = DEFAULT_EYE_Z;
		
		this.loc_x = DEFAULT_LOC_X;
		this.loc_y = DEFAULT_LOC_Y;
		this.loc_z = DEFAULT_LOC_Z;
		
		this.upVector_x = DEFAULT_UPVECTOR_X;
		this.upVector_y = DEFAULT_UPVECTOR_Y;
		this.upVector_z = DEFAULT_UPVECTOR_Z;
	}
	
	public void update(GLU glu)
	{
		glu.gluLookAt(eye_x, eye_y, eye_z, loc_x, loc_y, loc_z, upVector_x, upVector_y, upVector_z);
	}
	
	public void moveEye(float x, float y, float z)
	{
		eye_x += x;
		eye_y += y;
		eye_z += z;
	}
	
	public void lookAt(float x, float y, float z)
	{
		loc_x += x;
		loc_y += y;
		loc_z += z;
	}
	
	public void upVector(float x, float y, float z)
	{
		upVector_x += x;
		upVector_y += y;
		upVector_z += z;
	}
}
